package org.darkforest.ucenter.service;

import org.darkforest.common.util.Page;
import org.darkforest.enums.MemberType;
import org.darkforest.enums.OrderLogEnum;
import org.darkforest.model.Member;
import org.darkforest.model.MemberWithBLOBs;
import org.darkforest.vo.*;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 
 * 项目名称         :bwmall-ucenter
 * 文件名           :MemberService.java
 * 开发公司及作者    :陈超
 * 版本号及开发日期  :Rev. 1.00 (2015年2月7日)
 */
public interface MemberService {
	
	/**
	 * 获取账户信息
	 * @param memberId
	 * @return
	 */
	public MemberWithBLOBs findMemberById(Integer memberId);

	/**
	 * 获取常用的用户账户信息，不包含权限信息等
	 * @param memberId
	 * @return
	 */
	public Member findSimpleMemberById(Integer memberId);


	public Map<String, Object> getOrderSimpleCount(Integer memberId);
	
	public int updateMember(MemberWithBLOBs vo);

	public int updateMemberBaseInfo(Member member);

	public Member getBaseMemberInfo(String userName);
	
	public WapAjaxMsg<MemberBase> regist(Member member);

	public WapAjaxMsg<MemberBase> login(String userName, String pwd);

	public WapAjaxMsg<MemberBase> login(String userName, String pwd,String ip);

	public WapAjaxMsg<MemberBase> logout(String userName, String key);
	
	
	public void updatePic(Integer memberId, String picName);
	
	public void sendMobileCode(Integer memberId, String mobile);
	
	
	public void sendChangeMailCode(Integer memberId, String email, String basePath);
	
	public String checkMail(Integer memberId, String code, String email);
	
	public String checkMobile(Integer memberId, String code, String mobile);
	
	public void sendMailCode(Integer memberId, String email, String basePath);
	
	public String checkPayPwd(Integer memberId, String code, String pwd);
    public Member checkUserAndPassword(String memberName, String password);

	public List<Member> findByCondition(Member condition);

	public Page<Member> getMemberListForAdmin(MemberSearchBean param);

	List<Member> getMemberInfoByCond(Member member);

	public int updateMemberType(Integer memberId, MemberType memberType);

	/**
	 * 微信端新增或更新用户信息
	 * @param userDetailInfo
	 * @param recommendId
	 * @return
	 */
	public MemberWithBLOBs saveWxUserInfo(WxUserDetailInfo userDetailInfo, String recommendId);

	/**
	 * 修改用户登录密码
	 * @param memberId
	 * @param code
	 * @param newPwd
	 */
	String checkLoginPwd(Integer memberId, String code, String newPwd);

	public Member getUcenterMemberById(Integer userId);

        List<Member> getMemberByCond(Member member);
	/**
	 * 冻结卖家的电子币以及可用余额
	 * @param memberId
	 * @param goodsAmount
	 * @return
	 */
	public int freezeMemberDeposit(Integer orderId,String orderSn,Integer memberId,BigDecimal goodsAmount);

	/**
	 * 返还多扣除的保证金
	 * @param orderSn
	 * @param memberId
	 * @param cash
	 * @return
	 */
	public int returnDeposit(Integer orderId,String orderSn, Integer memberId,  BigDecimal cash,OrderLogEnum orderLogEnum);
	/**
	 * 支付后取消订单，返回支付货款
	 * @param orderSn
	 * @param buyerId
	 * @param pdAmount
	 */
	public int returnPayment(Integer orderId,String orderSn, Integer buyerId,  BigDecimal pdAmount);
	/**
	 * 支付后取消订单，返回支付货款
	 *  第三方登录
	 */
	public WapAjaxMsg<MemberBase> ThirdPartyRegist(Member member);

	public Member checkUser(String memberName);


}
